package org.jimmy.tang.innerclass;

/**
 * @author jimmy
 * 
 */
public class AnonymousInnerclassDemo {

    public static void main(String... arg) {
        OuterClass1 outerClass = new OuterClass1();
        outerClass.setSecret(100);
        System.out.println(outerClass.getInfo());
    }
}

class OuterClass1 {
    private int secret;

    public void setSecret(int secret) {
        this.secret = secret;
    }

    public int getInfo() {
        return new Pair() {
            @Override
            public int getSecret() {
                return secret;
            }

            private int take;
        }.getSecret();
    }
}

interface Pair {
    public int getSecret();
}
